# -*- coding: utf-8 -*-
"""
	@author:sirius
	@time:2017.10.19
"""

# 写入文件
def write_file(str_of_content, file_name, str):
    f = open(file_name, 'w')
    try:
        f.write(str_of_content)
    except Exception as e:
        print('文件写入失败!')
    finally:
        f.close()
        print(str + '-Finished...')

# 追加写入文件
def write_file_add(str_of_content, file_name, str):
    f = open(file_name, 'a')
    try:
        f.write(str_of_content)
    except Exception as e:
        print('文件写入失败!')
    finally:
        f.close()
        print(str + '-ADDFinished...')
